<template>
  <div id="test1">
    <el-card>
      <span>数据概况</span>
      <div
        style="
          text-align: center;
          justify-content: center;
          display: flex;
          margin-bottom: 30px;
          margin-top: 20px;
        "
      >
        <el-col :span="5">
          <el-card
            class="card1"
            shadow="hover"
            style="height:100px; margin-right:20px; margin-left:20px color:#e76f51"
          >
            <span>学校总数</span>
            <h2 style="color: #ffffff">1234</h2>
          </el-card>
        </el-col>
        <el-col :span="5">
          <el-card
            class="card2"
            shadow="hover"
            style="height: 100px; margin-right: 20px; margin-left: 20px"
          >
            <span>学生总数</span>
            <h2 style="color: #ffffff">{{totalList.student_number}}</h2>
          </el-card>
        </el-col>
        <el-col :span="5">
          <el-card
            class="card3"
            shadow="hover"
            style="height: 100px; margin-right: 20px; margin-left: 20px"
          >
            <span>今日通行人数</span>
            <h2 style="color: #ffffff">1234</h2>
          </el-card>
        </el-col>
        <el-col :span="5">
          <el-card
            class="card4"
            shadow="hover"
            style="height: 100px; margin-right: 20px; margin-left: 20px"
          >
            <span>本月累计通行人数</span>
            <h2 style="color: #ffffff">1234</h2>
          </el-card>
        </el-col>
      </div>
    </el-card>
    <el-card>
      <span>接送记录</span>
    </el-card>
    <el-card>
      <span>进出记录</span>
    </el-card>
    <el-card>
      <span>通行人次</span>
      <div ref="main" style="width: 100%; height: 400px; margin: 0 auto" />
    </el-card>
  </div>
</template>
<script>
export default {
  name: "ShouYe",
  //组件创建
  created() {
    //this.getList();
  },
  mounted() {
    this.initEcharts()
  },
  data() {
    return {
      //所有数据
      totalList: [],
    };
  },
  methods: {
    /**查询数据 
    getList() {
      this.loading = true;
      listIndex(this.queryParams).then((response) => {
        this.totalList = response.data;
        this.loading = false;
      });
    },*/
    initEcharts() {
      var myChart = this.$echarts.init(this.$refs.main);
      var option = {
        xAxis: {
          type: "category",
          data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
        },
        yAxis: {
          type: "value",
        },
        series: [
          {
            data: [150, 230, 224, 218, 135, 147, 260],
            type: "line",
          },
        ],
      };
      option && myChart.setOption(option);
    },
  },
};
</script>
<style lang="less" scoped>
.card1 {
  background-color: #e76f51;
}
.card2 {
  background-color: #f4a261;
}
.card3 {
  background-color: #e9c46a;
}
.card4 {
  background-color: #2a9d8f;
}
</style>
